{% extends "layout/admin.html" %}

{% block title %}修改配送方式{% endblock %}

{% block content %}
<div class="mb10 fl"><a class="but" href="/admin/distributions" >返回配送方式管理</a></div>
<hr/>
<h1>修改配送方式</h1>
{%set messages=handler.get_flashed_messages() %}
{%if messages%}
    <div class="msg">
        {% for type, msg in messages%}
            <span>{{msg}}</span>
        {% endfor %}
    </div>
{%endif%}

<form action="" method="post">

    {{xsrf()}}
<div class="form-group">
	<label>分类</label>
		<select name="pdid">

            <option value="0" {%if distribution.pdid == 0 %}selected{%-endif%}>无分类</option>

            {% if distribution.pdid > 0%}

            {% for ds in distributions-%}

            <option value="{{ds.id}}" {% if ds.id == distribution.pdid -%}selected{%-endif%}>{{ds.name}}</option>

            {%-endfor %}

            {% endif %}

            </select>
</div>
        <div class="form-group">
        <label>方式</label>
    <input type="text" name="name" class="input" maxlength="20" placeholder="最多10字"  value="{{distribution.name}}"> 
</div>
<div class="form-group">
        <label>费用</label>
    <input type="text" name="price" class="input" maxlength="4" value="{{distribution.price}}"> 0为免费
</div>
<div class="form-group">
        <label>介绍</label>
    <input type="text" name="content" class="input" maxlength="100" value="{{distribution.content}}">
</div>

<div class="form-group">
    <input type="submit" name="sub" value="修改" class="sub">
</div>
</form>

{% endblock %}